<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        li {
            list-style: none;
        }

        a {
            color: inherit;
            text-decoration: none;
        }

        img {
            vertical-align: top;
        }

        .clear::after {
            content: "";
            display: block;
            clear: both;
            height: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tab {
            width: 600px;
            margin: 50px auto;
        }

        .tab .tab-nav {
            line-height: 40px;
            text-align: center;
            display: flex;
        }

        .tab .tab-nav li {
            flex: 1;
            border: 1px solid #333;
        }

        .tab .tab-nav .active {
            background-color: #6ff;
            color: #fff;
        }

        .tab .tab-nav li+li {
            border-left: 0;
        }

        .tab .tab-part {
            height: 400px;
            border: 1px solid #333;
            border-top: 0;
        }

        .tab .tab-part .part {
            height: 400px;
            text-align: center;
            line-height: 400px;
            display: none;
        }

        .tab .tab-part .show {
            display: block;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="tab">
            <ul class="tab-nav">
                <!-- <li :class="{active:activeIndex==0}" @click="activeIndex=0">1</li>
                <li :class="{active:activeIndex==1}" @click="activeIndex=1">2</li>
                <li :class="{active:activeIndex==2}" @click="activeIndex=2">3</li>
                <li :class="{active:activeIndex==3}" @click="activeIndex=3">4</li>
                <li :class="{active:activeIndex==4}" @click="activeIndex=4">5</li>
                <li :class="{active:activeIndex==5}" @click="activeIndex=5">6</li> -->
                <li v-for="(n,i) in 6" :class="{active:activeIndex==i}" @click="activeIndex=i">{{n}}</li>

            </ul>
            <div class="tab-part">
                <!-- <div class="part" :class="{show:activeIndex==0}">1</div>
                <div class="part" :class="{show:activeIndex==1}">2</div>
                <div class="part" :class="{show:activeIndex==2}">3</div>
                <div class="part" :class="{show:activeIndex==3}">4</div>
                <div class="part" :class="{show:activeIndex==4}">5</div>
                <div class="part" :class="{show:activeIndex==5}">6</div> -->
                <div class="part" v-for="(n,i) in 6" :class="{show:activeIndex==i}">{{n}}</div>
            </div>
        </div>
    </div>
</body>
<script>
    // Vue实例/Vue应用  根实例
    var app = new Vue({
        el: "#app",
        data: {
            activeIndex: 0,
        }
    })


</script>

</html>